package networks.event;

public final class Delegate<T> {

    public static void CallAction(Action action) {
        action.Invoke();
    }

    public static <T> void CallActionOne(T param, ActionOne<T> action) {
        action.Invoke(param);
    }

    public static <TResult> TResult CallFunc(Func<TResult> func) {
        return func.Invoke();
    }

    public static <T, TResult> TResult CallFuncOne(T param, FuncOne<T, TResult> func) {
        return func.Invoke(param);
    }

    public interface Func<TResult> {
        public TResult Invoke();
    }

    public interface FuncOne<T, TResult> {
        public TResult Invoke(T o);
    }

    public interface Action {
        public void Invoke();
    }

    public interface ActionOne<T> {
        public void Invoke(T o);
    }
}
